package com.fastloan.mgt.chatapp.controller;

import com.fastloan.mgt.chatapp.service.ChatAppService;
import com.kawins.result.ResultEnum;
import com.kawins.result.ResultTo;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rankai
 *         createTime 2017-12-2017/12/8 15:31
 */
@RestController
@RequestMapping("/api/managerChatApp")
public class ManagerChatAppController {

    @Autowired
    private ChatAppService chatAppService;

    @PostMapping("/anon/buildQrcode")
    public ResultTo buildQrcode(String scene, String path) {
        if (StringUtils.isBlank(scene) || StringUtils.isBlank(path)) {
            return new ResultTo(ResultEnum.PARAM_ERROR);
        }
        return chatAppService.buildQrcode(scene, path);
    }

}
